<template>
    <div>
        <a-modal
        v-model:visible="printVisible"
        title="打印新聘任审评员实习审评评定表"
        @ok="printVisible = false"
        @cancel="printVisible = false"
        width="100%"
        wrapClassName="full-modal printInspector-New"
        >
        <div id="printTest" v-if="printVisible">
            <div v-for="(item,index) in list" :key="index">
                <div><h1 style="text-align: center;font-weight:600">新聘任审评员实习审评评定表</h1></div>
                <table border="1" class="printInspector-table">
                    <tr>
                        <th>姓名</th>
                        <td>{{ item.fjcyxm }}</td>
                        <th>工作单位</th>
                        <td >{{ item.fgzdw }}</td>
                    </tr>
                    <tr>
                        <th>审评范围<br/>（品种名称）</th>
                        <td>{{ item.fgzdw }}</td>
                        <th>审评时间与<br/>被审评单位</th>
                        <td >
                            <div>{{ item.fjcsj }}</div>
                            <div>{{ item.fqymc }}</div>
                        </td>
                    </tr>
                    <tr>
                        <th>审评组长</th>
                        <td>{{ item.fzzxm }}</td>
                        <th>审评类别</th>
                        <td >{{ item.fjclx }}</td>
                    </tr>
                    <tr>
                      <th>承担审评任务</th>
                       <td colspan="4" style="max-width:150px;text-align: left;padding-left:10px;">
                        {{item.fcdjcrw}}
                       </td>
                    </tr>
                    <!-- <tr>
                      <th>审评组长意见及评分：</th>
                      <td colspan="3" style="max-width:150px;text-align: left;padding-left:10px;">
                        {{item.fzzyj}}
                        <p style="text-align: right;">
                          <span>签名：</span>
                          <img v-if="item.signature.length > 22" :src="item.signature" alt="" class="yjqmImg">
                          <span v-else class="yjqmImg">{{item.fzzxm}}</span>
                        </p>
                      </td>
                    </tr> -->
                    <tr>
                        <td colspan="6" style="text-align: left;">
                            <span style="color: black;">实习审评员总结：</span>
                            <div v-html="item.fsxjcyzj"></div>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="6" style="text-align: left;">
                            <span style="color: black;">审评组长意见：</span>
                            <div v-html="item.fzzyj"></div>
                            <div style="width: 100%; text-align: right;">
                                <span>
                                    签名：
                                </span>
                                <img v-if="item.signature" :src="item.signature" alt="" class="yjqmImg">
                                <span v-else class="yjqmImg">{{item.fzzxm}}</span>
                            </div>
                        </td>
                    </tr>
                    <tr >
                        <!-- pddj001 -->
                        <!-- <th colspan="2">
                            <div style="display: flex;flex-wrap: nowrap;align-items: center;padding-left: 10px;">
                                组长评价建议：
                                <span v-for="nape in plainOptions" style="padding-right: 20px;display: flex;align-content: center;">
                                    <span v-if="item.ftjpj == nape.itemText">☑</span>
                                    <span style="line-height: 1.5;font-size: 23px;" v-else>☐</span>
                                    <span>{{ nape.itemText }}</span>
                                </span>
                            </div>
                        </th> -->
                        <th colspan="4">
                            <div style="display: flex;flex-wrap: nowrap;align-items: center;padding-left: 10px;">
                                考核结果：
                                <span v-for="nape in plainOptions" style="padding-right: 20px;display: flex;align-content: center;">
                                    <span v-if="item.fpj == nape.itemText">☑</span>
                                    <span style="line-height: 1.5;font-size: 23px;" v-else>☐</span>
                                    <span>{{ nape.itemText }}</span>
                                </span>
                            </div>
                        </th>
                    </tr>
                </table>
                <p style="width: 794px;margin: 0 auto;padding-left: 20px;">备注：请审评结束后 7 个工作日内将电子版发送至经办人邮箱。</p>
                <!--强行换页-->
                <div style="page-break-after:always"></div>
            </div>
        </div>
        <div style="display: flex;justify-content: center;margin: 20px;">
            <a-button type="primary" v-print="printObj">打印</a-button>
        </div>
        </a-modal>
    </div>
</template>
<script>
import { checkArray, shifou } from "@/views/everydayCheck/common/GroupConfig";
import { getDictListByDictCode,downMyQm } from "../api/prepareinspectorm"
export default {
    components:{

    },
    props:{

    },
    data(){
        return{
            plainOptions:[],
            printVisible:false,
            list:[],
            printObj:{
                id:"printTest", //需要打印的id名称
                popTitle:"问卷调查",//文档的名称
                // preview:true,//预览功能，不好用
                zIndex:'20002',
                beforeOpenCallback(vue){
                    //console.log('打印回调',vue)
                },
                openCallback (vue) {//打开之前
                    //console.log('打开之前',vue)
                },
                closeCallback (vue) {//关闭了打印工具
                    //console.log('关闭了打印工具')
                },

            },
            srcList:''
        }
    },
    watch:{

    },
    mounted(){
        getDictListByDictCode({dictCode:'pddj001'}).then(res=>{
            if(res.code == 200){
                this.plainOptions = res.result
            }
        })

    },
    methods:{
        getData(val){//在父组件调用次方法
            this.printVisible = true
            this.list = val


            // signature
            //console.log(this.list)
        },
    }
}
</script>
<style lang="less">
.full-modal {
  .ant-modal {
    max-width: 100%;
    top: 0;
    padding-bottom: 0;
    margin: 0;
  }
  .ant-modal-content {
    display: flex;
    flex-direction: column;
    height: calc(100vh);
    overflow-y: auto;
  }
  .ant-modal-body {
    flex: 1;
  }
}
// th,td{
//     padding: 10px;
// }
.term-box{
    display: flex;
    align-content: center;
    .term-value{
        padding-right: 5px;
    }
    .no-select{
        line-height: 1;
        font-size: 20px;
    }
}
.printInspector-New {
  span {
        word-wrap:break-word;
        word-break:break-all;
        /* white-space:normal;*/
    }
  p {
        word-wrap:break-word;
        word-break:break-all;
        white-space:normal;
    }
    .yjqmImg {
      width: 100px;
      height: 30px;
      padding-right: 20px;
    }
    .ant-modal-body {
      height: calc(100vh - 100px) !important;
      overflow: scroll;
    }
}
.printInspector-table{
      width: 794px;
      margin: 0 auto;
      margin-top: 4mm;
      font-size: 16px;
      th {
        text-align: center;
        font-size: 18px;
        line-height: 2;
        padding: 0px;
        width: 130px;
        // color: black;
      }
      td {
        max-width: 150px;
        text-align: center;
        line-height: 2;
        padding: 0px 10px;
        font-size: 16px;
        font-weight: 100;
        // font-family: 'SimSun';
        word-wrap:break-word;
        word-break:break-all;
        white-space:normal;
      }
      .ant-input {
        font-weight: 600;
        max-height: none;
      }
        form .ant-mentions, form textarea.ant-input {
            margin-bottom: 0px;
            height: 46px;
        }
      .ant-input-group.ant-input-group-compact .ant-input {
        max-height: none;
      }
      .ant-upload-list {
        display: none;
      }
      p {
        margin-left: 10px;
        margin-right: 10px;
      }
    }
</style>
